<?php

function getSubCategoryID($item) {
             include '../phpFunctions/databaseConnect.php';
             $result = mysql_query("select subCategory from item_subCategory where item= $item" );
             $row = mysql_fetch_array($result);
             $subcategoryID = $row['subCategory'];

             return $subcategoryID;


}

function getSubCategory($subcategoryID) {
             include '../phpFunctions/databaseConnect.php';

             $result = mysql_query("select subCategoryName from subCategory where subCategory_id= $subcategoryID " );
             $row = mysql_fetch_array($result);
             $subcategoryName= $row['subCategoryName'];

return $subcategoryName;


}


// Need the subcategory from above
function getMainCategory($subcategoryID) {
             include '../phpFunctions/databaseConnect.php';
             $result = mysql_query("select parentCategoryID from subCategory where subCategory_id= $subcategoryID" );
             $row = mysql_fetch_array($result);
             $maincategoryID = $row['parentCategoryID'];
             
             $result = mysql_query("select categoryName from category where category_id= $maincategoryID" );
             $row = mysql_fetch_array($result);
             $maincategoryName= $row['categoryName'];
             
return $maincategoryName;


}




?>
